package com.djq.hhc.feign;

import com.djq.hhc.result.Result;
import feign.Headers;
import feign.RequestLine;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: dadd7
 * @Date: 2023/03/08/下午 10:18
 * @Description:
 */


@FeignClient(value = "service-credit")
public interface CreditInfoFeignClient {

    @GetMapping("/credit/creditInfo/getCreditByUserId/{id}")
    Result getCreditByUserId(@RequestHeader("Authorization") String token, @PathVariable String id); //Feign不支持Long

    @GetMapping("/credit/creditInfo/getCredit/{userId}")
    Integer getCredit(@RequestHeader("Authorization") String token, @PathVariable String userId);

    @PutMapping("/credit/creditInfo/discountCredit/{price}/{credit}")
    boolean discountCredit(@RequestHeader("Authorization") String token, @PathVariable Integer price, @PathVariable Integer credit);
}
